<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        1. 执行try，没有错误，try代码全部执行完毕，忽略catch
        2. 执行try，有错误，try代码在错误处中断执行，执行catch
      */
      try {
        console.log("1");
        console.log(username);
        console.log("3");
        console.log("4");
      } catch (e) {
        console.log("2");
      }
    </script>
  </body>
</html>
